//// demo_prog/chapter4/demo4_8_1.c
// 例4.8, 第一种解法: 在if部分嵌套

#include <stdio.h>

int main(void) 
{
  int year = 0, leap = 0;
  scanf("%d", &year);
  if (year % 4 == 0) 
  {
    if (year % 100 == 0) 
    {
      if (year % 400 == 0)
      {
        leap = 1;
      }
      else // 能被100整除但不能被400整除
      {
        leap = 0;
      }
    } 
    else //不能被100整除
    {
      leap = 1;
    }
  } 
  else // 不能被4整除
  {
    leap = 0;
  }
  if (leap)
  {
    printf("%d is ", year);
  }
  else
  {
    printf("%d is not ", year);
  }
  printf("a leap year.\n");
  return 0;
}